package com.bi.design.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bi.design.pojo.BaseModel;
import javax.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import javax.validation.constraints.Pattern;
import java.util.Date;

@Getter
@Setter
@TableName("sys_user")
public class SysUser extends BaseModel {

    private static final long serialVersionUID = -586883731206371299L;

    @TableField("nick_name")
    @NotBlank(message = "姓名(简称)不能为空")
    @Length(max = 32, message = "姓名(简称)长度不能超过32个字符")
    private String nickName;

    @TableField("account")
    @NotBlank(message = "登陆账号不能为空")
    @Length(max = 12, message = "登陆账号长度不能超过12个字符")
    @Pattern(regexp = "^[A-Za-z0-9]{2,12}$", message = "账号由英文、数字组成，并且长度为2-12位")
    private String account;

    @TableField("password")
    @Length(max = 16, message = "密码长度不能超过16个字符")
    @Pattern(regexp = "^[a-z_A-Z0-9-\\.!@#\\$%\\\\\\^&\\*\\)\\(\\+=\\{\\}\\[\\]\\/\",'<>~\\·`\\?:;|]{6,16}$", message = "密码由英文、数字、符号组成，且长度为6-16位")
    private String password;

    @TableField("contact")
    private String contact;

    @TableField("contact_tel")
    private String contactTel;

    @TableField("remarks")
    private String remarks;

    @TableField("disabled")
    private Boolean disabled;

}
